<?php

require_once PATH_CLASS."table.class.php";

class saison_type extends table{

    CONST CLASS_NAME  = 'saison_type';
    CONST TABLE_NAME  = 't_saisons_type';
    CONST PRIMARY_KEY = 'saison_type';

    var $saison_type;         
	var $saison_type_lib;
	var $saison_type_smalllib;

    public static function getTableName() {
      return self::$TABLE_NAME;
    }

    public static function getClassName() {
      return self::$CLASS_NAME;
    }

    public static function getPrimaryKey() {
      return self::$PRIMARY_KEY;
    }
    
    const CHAMPIONNAT   = 'C';
    const JOUTELIBRE    = 'J';
    
  /**
   *
   * @param type $array
   * @return saison
   */
  
  public function __construct($array) {
    parent::__construct($array);
    return $this;
  }
  
  /**
   *
   * @param int $id
   * @param string $by
   * @param string $order_by
   * @return saison or array
   */
  
  public static function getSaisonType($type){
    $db = self::getDb();

    $sql =  sprintf("select * from %s where %s = %s",self::TABLE_NAME,self::PRIMARY_KEY,$type);

    $ret = self::getAll($sql);
    
    return $ret;

  }
  
}

